/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dale2507.gates.data.permissions;

import dale2507.gates.data.permissions.bukkit.BukkitPermissions;
import dale2507.gates.exceptions.PermissionException;

/**
 *
 * @author Dale
 */
public class Permissions {
    
    private static IPlayerPermissions permissions;
    
    public static void setPermissions(IPlayerPermissions permissions) {
        Permissions.permissions = permissions;
    }
    
    public static IPlayerPermissions getPermissions() throws PermissionException {
        if (Permissions.permissions == null) throw new PermissionException("No permissions plugin has been setup to work with Gates.");
        return Permissions.permissions;
    }
    
    public static void detectPermissions() {
        Permissions.permissions = new BukkitPermissions();
    }
    
}
